package com.atguigu.gmall.feign.order;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.entity.OrderInfo;
import com.atguigu.gmall.order.vo.OrderConfirmVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Description
 * @Return
 * @Author https://weiranyi.github.io
 * @Date Created in 2022-12-21 09:12
 **/
@RequestMapping("/api/inner/rpc/order")
@FeignClient("service-order")
public interface OrderFeignClient {
    /**
     * 返回确认页数据
     *
     * @return
     */
    @RequestMapping("/confirmData")
    public Result<OrderConfirmVo> getOrderConfirmData();

    /**
     * 返回订单信息
     *
     * @param orderId
     * @return
     */
    @GetMapping("/info/{orderId}")
    public Result<OrderInfo> getOrderInfo(@PathVariable("orderId") Long orderId);

    /**
     * 保存秒杀单
     * @param orderInfo
     * @return
     */
    @PostMapping("/submitOrder")
    public Result<Long> saveOrder(@RequestBody OrderInfo orderInfo);
}
